import 'package:flutter/material.dart';
import 'package:flutterdemo/webview/common_web_page.dart';
import 'package:flutterdemo/webview/web_view_page.dart';

void main() {
  runApp(MaterialApp(
    home: HomePage(),
  ));
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: RaisedButton(
        onPressed: _webView,
        child: Text("webview"),
      ),
    );
  }

  void _webView() {
    Navigator.push(context, MaterialPageRoute(builder: (context) => CommonWebPage(url: "https://www.baidu.com",
      title: "web",)));
  }
}
